"""project URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
"""

from django.contrib import admin
from django.urls import path, include
from rest_framework import routers

from .api.views import index_view, MessageViewSet
from .api.views import MyModels
from backend.api.views import call_model
from backend.api.views import add_model
# from backend.api.views import ClassifyFishes

router = routers.DefaultRouter()
router.register('messages', MessageViewSet)
router.register('dlmodels', MyModels)
# router.register('classify_fish', ClassifyFishes, basename='classify_fish')
# router.register('classify_fish', ClassifyFishes, basename='ClassifyFishes')

urlpatterns = [
    path('admin/', admin.site.urls),
    # http://localhost:8000/
    path('', index_view, name='index'),

    # http://localhost:8000/api/<router-viewsets>
    path('api/', include(router.urls)),
    path('api/classify_fish/', call_model),
    path('api/add_deployed_model/', add_model),

    # http://localhost:8000/api/admin/
    # path('api/admin/', admin.site.urls),

    # 数据接口
    # path('models/list/', admin.site.urls),
]
